package com.freesky.provider.member.service;

import com.freesky.common.dao.entity.Member;
import com.freesky.common.pojo.DataTablesResult;
import com.freesky.common.vo.VOMember;

/**
 * @author Freesky
 * @date 2017/8/11
 */
public interface IMemberService {

    /**
     * 根据ID获取会员信息
     * @param memberId
     * @return
     */
    Member getMemberById(long memberId);

    /**
     * 分页获得会员列表
     * @param draw
     * @param start
     * @param length
     * @param search
     * @return
     */
    DataTablesResult getMemberList(int draw, int start, int length, String search,
                                   String minDate, String maxDate, String orderCol, String orderDir);

    /**
     * 分页获得移除会员列表
     * @param draw
     * @param start
     * @param length
     * @param search
     * @param minDate
     * @param maxDate
     * @param orderCol
     * @param orderDir
     * @return
     */
    DataTablesResult getRemoveMemberList(int draw, int start, int length, String search,
                                         String minDate, String maxDate, String orderCol, String orderDir);

    /**
     * 获得所有会员总数
     * @return
     */
    DataTablesResult getMemberCount();

    /**
     * 获得删除会员
     * @return
     */
    DataTablesResult getRemoveMemberCount();

    /**
     * 通过邮件获取
     * @param email
     * @return
     */
    Member getMemberByEmail(String email);

    /**
     * 通过手机获取
     * @param phone
     * @return
     */
    Member getMemberByPhone(String phone);

    /**
     * 通过获取名获取
     * @param username
     * @return
     */
    Member getMemberByUsername(String username);

    /**
     * 添加会员
     * @param voMember
     * @return
     */
    Member addMember(VOMember voMember);

    /**
     * 更新会员信息
     * @param id
     * @param voMember
     * @return
     */
    Member updateMember(Long id, VOMember voMember);

    /**
     * 修改会员密码
     * @param id
     * @param voMember
     * @return
     */
    Member changePassMember(Long id, VOMember voMember);

    /**
     * 修改会员状态
     * @param id
     * @param state
     * @return
     */
    Member alertMemberState(Long id, Integer state);

    /**
     * 彻底删除会员
     * @param id
     * @return
     */
    int deleteMember(Long id);

    /**
     * 验证编辑邮箱是否存在
     * @param id
     * @param email
     * @return
     */
    Member getMemberByEditEmail(Long id, String email);

    /**
     * 验证编辑手机是否存在
     * @param id
     * @param phone
     * @return
     */
    Member getMemberByEditPhone(Long id, String phone);

    /**
     * 验证编辑用户名是否存在
     * @param id
     * @param username
     * @return
     */
    Member getMemberByEditUsername(Long id, String username);



    /**
     * 头像上传
     * @param userId
     * @param token
     * @param imgData
     * @return
     */
    String imageUpload(Long userId, String token, String imgData);

    /**
     * 勾选
     * @param param
     * @param type
     * @return
     */
    boolean checkData(String param, int type);

    /**
     * 注册
     * @param userName
     * @param userPwd
     * @return
     */
    int register(String userName, String userPwd);

    /**
     * 登录
     * @param username
     * @param password
     * @return
     */
    com.freesky.common.vo.portal.VOMember userLogin(String username, String password);

    /**
     * 通过token获取
     * @param token
     * @return
     */
    com.freesky.common.vo.portal.VOMember getUserByToken(String token);

    /**
     * 注销
     * @param token
     * @return
     */
    int logout(String token);
}
